<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<html>
	<head>
		<title>订单信息查看</title>
<%@ include file="/comm.jsp"%>
		<script language="javascript">
			function checkSubmit(status){
				var form=document.getElementById("formpage");
				if(status=="A01" || status=="A02"){//审核
					$d("hdfAuditflag").value=status;
					form.action="order_auditOrder.do";
				}else if(status=="A03"){//生成数据
					form.action="order_createSeal.do";
				}else if(status=="A06"){//发货
					form.action="order_sendSeal.do";
				}else if(status=="FENPEI"){//分配条码
					form.action="order_distributeBarcode.do";
				}
				form.submit();
				return true;
			}
			
	</script>
		<style type="text/css">
<!--
fieldset {
	padding: 10px;
	margin: 10px;
	width: 100%;
	color: #333;
}

legend {
	color: #06c;
	font-weight: 800;
	background: #fff;
}
-->
</style>
	</head>

	<body>
		<%@ include file="/messages.jsp"%>
		<s:form action="order_createSeal" namespace="/" name="formpage">
			<input type="hidden" id="hdfAuditflag" name="auditflag" />
			<input type="hidden" name="orderInfo.id" value="${orderInfo.id}" />
			<div>
				<table width="100%" class="tb_input" border="0" cellpadding="0"
					cellspacing="1">
					<tr>
						<td width="200px" valign="top">
							<table width="100%" class="tb_input" border="0" cellpadding="0"
								cellspacing="1">
								<tr>
									<td>
										订购商品信息(订单号:${orderInfo.id })
									</td>
								</tr>
								<tr>
									<td align="center">
										<IMG height="180" width="180" alt="商品图片"
											src="<%=request.getContextPath()%>/upload/seal/s_${product.image1}">
									</td>
								</tr>
								<tr>
									<td>
										<table border="0" cellpadding="0" cellspacing="1">
											<tr>
												<td align="right">
													商品名称：
												</td>
												<td>
													${orderInfo.productName}
												</td>
											</tr>
											<tr>
												<td align="right">
													型号：
												</td>
												<td>
													${orderInfo.type}
												</td>
											</tr>
											<s:if test='1==#request.orderInfo.sid'>
											<tr>
												<td align="right">
													颜色：
												</td>
												<td>
													<input type="hidden" name="orderInfo.color"
														value="${orderInfo.color}" />
													${orderInfo.color}
												</td>
											</tr>
											</s:if>
											<tr>
												<td align="right">
													单价：
												</td>
												<td>
													${orderInfo.price}
													<s:if test='"RMB"==#request.orderInfo.currtype'>
														元
													</s:if>
													<s:elseif test='"USD"==#request.orderInfo.currtype'>
														美元
													</s:elseif>
												</td>
											</tr>
											<tr>
												<td align="right">
													积分：
												</td>
												<td>
													${orderInfo.score}
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
						<td valign="top">
							<!-- 订单审核/查看时显示 -->
							<s:if test='"2"!=#request.operflag'>
								<div>
									<table width="100%" class="tb_input" border="0" cellpadding="0"
										cellspacing="1">
										<tr>
											<td colspan="2">
												收货地址
											</td>
										</tr>

										<tr>
											<td align="right" width="110">
												公司名称：
											</td>
											<td>
												${orderInfo.companyName }(${orderInfo.userId })
											</td>
										</tr>

										<tr>
											<td align="right" width="110">
												收货人姓名：
											</td>
											<td>
												${orderInfo.userName }
											</td>
										</tr>
										<tr>
											<td align="right">
												手机：
											</td>
											<td>
												${orderInfo.cellphone }
											</td>
										</tr>
										<tr>
											<td align="right">
												电话：
											</td>
											<td>
												${orderInfo.countryCode }-${orderInfo.regionCode
												}-${orderInfo.telephone }
											</td>
										</tr>
										<tr>
											<td align="right">
												邮政编码：
											</td>
											<td>
												${orderInfo.postcode }
											</td>
										</tr>
										<tr>
											<td align="right">
												收货地址：
											</td>
											<td>
												<textarea id="address" rows="3" readonly="readonly"
													cols="50">${orderInfo.address }</textarea>
											</td>
										</tr>
									</table>
								</div>
							</s:if>

							<div>
								<table width="100%" class="tb_input" border="0" cellpadding="0"
									cellspacing="1">
									<tr>
										<td colspan="2">
											订购信息
										</td>
									</tr>
									<s:if test='1==#request.orderInfo.sid'>
									<tr>
										<td align="right" width="110">
											封条编码规则：
										</td>
										<td>
											<s:if test='"01"==#request.orderInfo.roleType'>
											全数字
											</s:if>
											<s:if test='"02"==#request.orderInfo.roleType'>
											字符前缀(${orderInfo.seqChar })+数字
											</s:if>
											&nbsp;编码位数：${orderInfo.seqLen }&nbsp;&nbsp;
											商标：${orderInfo.trademark }
										</td>
									</tr>
									</s:if>
									<tr>
										<td align="right">
											订购数量：
										</td>
										<td>
											${orderInfo.amount } (最小订购数量${product.minOrderNum}条)
										</td>
									</tr>
									<tr>
										<td align="right" valign="top">
											订单留言：
										</td>
										<td>
											<textarea id="message" rows="4" readonly="readonly" cols="50">${orderInfo.message }</textarea>
										</td>
									</tr>
									<tr>
										<td align="right" valign="top">
											系统备注：
										</td>
										<td>
											<textarea id="remark" rows="4" cols="50"
												name="orderInfo.remark">${orderInfo.remark }</textarea>
										</td>
									</tr>
								</table>
							</div>
							<div>
								赠送积分：
								<span id="totalscore"> ${orderInfo.totalscore} </span> 点 订单金额：
								<span id="totalprice"> ${orderInfo.totalprice} </span>
								<s:if test='"RMB"==#request.orderInfo.currtype'>
									元
								</s:if>
								<s:elseif test='"USD"==#request.orderInfo.currtype'>
									美元
								</s:elseif>
							</div>

							<!-- 只在封条生成时才显示 (审核通过且未生成完成) -->
							<s:if test='"2"==#request.operflag && 1==#request.orderInfo.sid'>
								<div>
									<br />
									<table width="100%" border="0" cellpadding="0" cellspacing="0"
										class="tb_datalist">
										<tr>
											<td colspan="2">
												封条数据生成 (还需生成${leftCount }条记录)
												<input type="hidden" name="seqRole.id" value="${seqRole.id}" />
												<input type="hidden" name="seqRole.numLen" value="${seqRole.numLen}" />
												<input type="hidden" name="seqRole.seqLen" value="${seqRole.seqLen}" />
											</td>
										</tr>
										<tr>
											<td align="right" width="110">
												封条编码规则：
											</td>
											<td>
												<s:if test='"01"==#request.orderInfo.roleType'>
												全数字
												起始封条号：
												<input type="text" size="15" maxlength="15"
														name="seqRole.seqNum" value="${seqRole.seqNum }" />
												</s:if>
												<s:if test='"02"==#request.orderInfo.roleType'>
												字母前辍+数字
												<input type="text" size="5" maxlength="4"
														name="seqRole.seqChar" title="字母前辍"
														value="${seqRole.seqChar }" />
												+
												<input type="text" size="10" maxlength="10"
														name="seqRole.seqNum" title="起始封条号"
														value="${seqRole.seqNum }" />
												</s:if>
											</td>
										</tr>

									</table>
								</div>
							</s:if>

							<!-- 只在条码分配时才显示 (审核通过且未分配完成) -->
							<s:if test='"2"==#request.operflag && 2==#request.orderInfo.sid'>
								<div>
									<br />
									<table width="100%" border="0" cellpadding="0" cellspacing="0"
										class="tb_datalist">
										<tr>
											<td colspan="2">
												条码数据分配 (还需分配${leftCount }个条码)
											</td>
										</tr>
										<!-- 
										<tr>
											<td align="right" width="110">
												条码起始编号：
											</td>
											<td>
												<input type="text" size="20" maxlength="20"
														name="seqRole.seqChar" 
														value="${leftCount }" />												
											</td>
										</tr>
 										-->
									</table>
								</div>
							</s:if>
							
							<!-- 操作按钮 -->
							<div>
								<br />
								<br />
								<s:if test='"1"==#request.operflag'>
									<input type="button" class="button" id="btnCheckSucc"
										value="审核通过" onclick="return checkSubmit('A01');" />
									<input type="button" class="button" id="btnCheckFail"
										value="审核不通过" onclick="return checkSubmit('A02');" />
								</s:if>
								<s:if test='"2"==#request.operflag'>
									<s:if test='1==#request.orderInfo.sid'>
										<input type="button" class="button" id="btnCreateSeq"
											value="生成封条" onclick="return checkSubmit('A03');" />
									</s:if>
									<s:else>
										<input type="button" class="button" id="btnFenpeiSeq"
												value="分配条码" onclick="return checkSubmit('FENPEI');" />
									</s:else>
								</s:if>
							
								<s:if test='"3"==#request.operflag'>
									<input type="button" class="button" id="btnCreateSeq"
										value="确认发货" onclick="return checkSubmit('A06');" />
								</s:if>
								<input type="button" class="button" id="btnCancel" value=" 返 回 "
									onclick="javascript:history.go(-1);" />
							</div>
						</td>
					</tr>
				</table>
			</div>
		</s:form>
	</body>
</html>
